package com.kaver.modular.dc.service.impl;

import com.kaver.modular.system.model.DcApp;
import com.kaver.modular.system.dao.DcAppMapper;
import com.kaver.modular.dc.service.IDcAppService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;

import java.util.List;

import org.springframework.stereotype.Service;

/**
 * <p>
 * 应用 服务实现类
 * </p>
 *
 * @author Roc
 * @since 2019-01-29
 */
@Service
public class DcAppServiceImpl extends ServiceImpl<DcAppMapper, DcApp> implements IDcAppService {

	@Override
	public Integer getAppIdByName(String appName) {
		DcApp entity = new DcApp();
		entity.setAppName(appName);
		DcApp app = baseMapper.selectOne(entity);
		if (app != null) {
			return app.getId();
		}
		return null;
	}

	@Override
	public List<DcApp> getUserApp(Integer userId) {
		return this.baseMapper.getUserApp(userId);
	}

}
